import request from "@/request"

// 保存
export const SaveData = (data) => {
    return request.post(`v1/sys/api/save`,data)
}

// 查询所有菜单
export const FindData = (data={keyword:''}) => {
    return request.post(`v1/sys/api/find/list?keyword=${data?.keyword}`, data)
}

// 查询父菜单
export const LoadRootData = ()=>{
    return request.post(`v1/sys/api/find/root`,{})
}

// 根据ID查询
export const GetById = (data) => {
    return request.post(`v1/sys/api/getById/${data}`)
}

// 更新
export const UpdateData = (data) => {
    return request.post(`v1/sys/api/update`,data)
}

// 修改状态
export const UpdateStatus = (data)=>{
    return request.post("v1/sys/api/update/status",data)
}

// 复制数据
export const CopyData = (id)=>{
    return request.post(`v1/sys/api/copy/${id}`, {})
}

// 删除单个用户
export const DeleteById = (id) => {
    return request.post(`v1/sys/api/deleteById/${id}`)
}

// 批量删除
export const DeleteByIds = (ids) => {
    return request.post(`v1/sys/api/deleteByIds?ids=${ids}`)
}
